home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AmigActive 10
/
AACD 10.iso
/
AACD
/
Utilities
/
GOCR
/
src
/
Makefile
< prev
next >
Wrap
Makefile
|
2000-05-29
|
4KB
|
155 lines
#
# please modify following lines, if you use another compiler
#
VPath=gocr_0_2
CC=gcc
# debug flags
DFLAGS= -pedantic
CFLAGS= -xc++ -O0 $(DFLAGS) -Wall -pipe -g -ansi # -v (debug)
LIB= -g # -lm -static
INC=
SRC=c
#
# include config
# Options are:
# -r all tgz untgz zip clean install tar dist check test archiv
#
# send bug-reports to jschulen@altmark.nat.uni-magdeburg.de
CFILES = pgm2asc.cc jconv.cc pnm.cc pcx.cc tga.cc ocr0.cc ocr1.cc
OFILES = pgm2asc.o jconv.o pnm.o pcx.o tga.o ocr0.o ocr1.o
FILES = $(CFILES) Makefile *.h README README.DE font?.tex text.tex ocr.tex *.html
# export all make-variables to submakes
#export # geht nicht auf iris!
# Format of a make Description File Entry
# The general form of an entry is:
# target1 [target2..]:[:] [parent1..][; command]...
# [(tab) commands]
#
# Translating everything:
.SUFFIXES: .o .cc .pgm .asc
.cc.o:
$(CC) $(CFLAGS) -c -o $*.o $<
.pgm.asc: a.out
./a.out -i $*.pgm
# nur erste Regel oder optional angegebene Regel wird ausgefuehrt!!!
#all: gocr.tgz gocr
all: gocr jconv
# @echo "make gocr # make ocr-exe"
# @echo "make jconv # convert pnm pcx and tga"
# @echo "make database" # create database (LaTeX,gs needed)
jconv: jconv.o pnm.o pcx.o tga.o
$(CC) -o jconv jconv.o pnm.o pcx.o tga.o
gocr.tgz: $(FILES)
tar -cf - $(FILES) | gzip -c >gocr.tgz
ocr.tar.Z: $(FILES)
tar -cf - $(FILES) | compress -c >ocr.tar.Z
.PHONY : zip
zip:
zip -k -q ocr.zip $(FILES)
@ls -al ocr.zip
database:
sh create_db
/* ======== dependencies ========== */
jconv.o: pnm.h pcx.h tga.h
pgm2asc.o: pnm.h ocr0.h ocr1.h pcx.h tga.h
ocr0.o: pgm2asc.h
ocr1.o: pgm2asc.h
pcx.o: pcx.h
tga.o: tga.h
.PHONY : install
install: a.out fonts
@$(MAKE) -f Makefile a.out
gocr: pgm2asc.o pnm.o pcx.o tga.o ocr0.o ocr1.o
$(CC) -o gocr pgm2asc.o pnm.o pcx.o tga.o ocr0.o ocr1.o $(LIB)
@echo "--- ./gocr is now installed ---"
font.tex: font1.tex
cp font1.tex font.tex
font.dvi: font.tex
latex font.tex
font.ps: font.dvi
dvips -E -o font.ps font.dvi # -PAPERSIZE=a4
text.dvi: text.tex
latex text.tex
text.ps: text.dvi
dvips -E -o text.ps text.dvi # -PAPERSIZE=a4
# dummerweise macht gs immer a4 aus boxed-ps => reduce picture
# gs options: pgmraw, pcxmono, laserjet
font1.pbm: font.ps jconv Makefile
gs -dNOPAUSE -q -r300 -sDEVICE=pbmraw \
-sOutputFile=font1.pbm - < font.ps
./jconv -shrink -pbm font1.pbm font1.pbm 0 0 0 0
font2.pbm: font.ps jconv Makefile
gs -dNOPAUSE -q -r150 -sDEVICE=pbmraw \
-sOutputFile=font2.pbm - < font.ps
./jconv -shrink -pbm font2.pbm font2.pbm 0 0 0 0
text.pbm: text.ps jconv Makefile
gs -dNOPAUSE -q -r150 -sDEVICE=pbmraw \
-sOutputFile=text.pbm - < text.ps
./jconv -shrink -pbm text.pbm text.pbm 0 0 0 0
# change this to make a man page to a test.pbm file
man.pbm: jconv Makefile
man -Tdvi man >man.dvi
dvips -o man.ps man.dvi
gs -dNOPAUSE -q -r300 -sDEVICE=pbmraw \
-sOutputFile=man.pbm - < man.ps
./jconv -shrink -pbm man.pbm man.pbm 0 0 0 0
rm -f man.ps man.dvi
fonts: font1.pbm font2.pbm
font.lj: font.ps # for scanner
gs -dNOPAUSE -q -r300 -sDEVICE=laserjet \
-sOutputFile=font.lj - < font.ps
.PHONY : tgz dist
dist: tgz
tgz: clean
-rm -f gocr jconv
(cd ..;tar --exclude=$(VPath)/tmp -cf - $(VPath) | gzip -c >gocr.tgz)
@ls -al ../gocr.tgz
.PHONY : archiv
archiv: gocr.tgz
# cp gocr.tgz gocr`date +%y%m%d`.tgz # yymmdd
# cp gocr.tgz gocr`date +%Y%j`.tgz # YYyyDDD D=day_of_year
# @ls -al *.tgz
.PHONY : untgz
untgz: # since 1998-139
gzip -d -c gocr.tgz | tar -xf -
# PHONY = don't look at file clean, -rm = start rm and ignore errors
.PHONY : clean
clean:
-rm -f $(OFILES)
-rm -f *.aux *.log *.dvi *.ps *.lj *~
# rm old versions
-rm -f convert.cc convert convert.o